ADO, set returning functions, ms acccess
am 02.10.2006 19:42:08 von brian stapel--_53a13916-81b5-4271-a0cc-47baaacfec5b_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Thanks for your time...
=20
I've written a plpgsql function that produces a recordset (i think):
=20
CREATE OR REPLACE FUNCTION "public"."function_name" (int integer) RETURNS S=
ETOF "public"."tbl_nm" AS$body$/* New function body */DECLARE rec pub=
lic.tbl_nm; BEGIN FOR rec IN select * from tbl_nm wh=
ere id <> int LOOP RETURN NEXT rec; END LOOP; E=
ND;$body$LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
=20
When I execute the function from the sql editor, it produces the desired re=
sults. select * from function_name(1);
=20
When I try to incorporate this function into my ado application, it doesn't=
seem to return a recordset. =20
=20
Dim objCnn As ADODB.Connection Dim cmd As ADODB.Command Dim rs As=
ADODB.Recordset Set objCnn =3D data_layer.Open_ConnectPostGRESq=
l(objCnn) Set cmd =3D New ADODB.Command cmd.ActiveCon=
nection =3D objCnn cmd.CommandText =3D "Select * from funct=
ion_name(1);" Set rs =3D cmd.Execute
=20
rs record count is -1.
=20
Can you help?
=20
____________________________________________________________ _____
Express yourself - download free Windows Live Messenger themes!=20
http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/ ?href=3Dhttp://=
imagine-msn.com/themes/vibe/default.aspx?locale=3Den-us&sour ce=3Dhmtagline =
--_53a13916-81b5-4271-a0cc-47baaacfec5b_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
=0A=
=0A=
=0A=
Thanks for your time...
I've written a plpgsql function that produces a recordset (i think):<=
/FONT>
CREATE OR REPLACE FUNCTION "public"."function_name" (int integer) RETURNS S=
ETOF "public"."tbl_nm" AS
$body$
/* New function body */
DECLARE R> rec public.tbl_nm<=
/FONT>;
BEGIN
&nbs=
p; FOR rec IN
&nbs=
p; select * from tbl_nm where id &=
lt;> int
LOOP
&nb=
sp; RETURN NEXT rec;<=
BR> END LOOP;
&nbs=
p; END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECUR=
ITY INVOKER;
When I execute the function from the sql editor, it produces the desired re=
sults. select * from function_name(1);
When I try to incorporate this function into my ado application, it doesn't=
seem to return a recordset.
Dim objCnn As ADODB.Connection
Dim=
cmd As ADODB.Command
Dim rs As ADODB.Recordset
&n=
bsp;
Set objCnn =
=3D data_layer.Open_ConnectPostGRESql(objCnn)
&n=
bsp; Set cmd =3D New ADODB.Command
&=
nbsp;
=
"
 =
; Set rs =3D cmd.Execute
rs record count is -1.
Can you help?
Express yourself - download free Windows Live Messeng=
er themes! ect/01/?href=3Dhttp://imagine-msn.com/themes/vibe/default.as px?locale=3Den-=
us&source=3Dhmtagline' target=3D'_new'>Get it now!=0A=
=
--_53a13916-81b5-4271-a0cc-47baaacfec5b_--